mergedString = ""
File.open($buildfile, File::RDONLY).each { |line|
  mergedString += File.read(line.chomp)
}

outputFile = File.new($outputfile, "w")
outputFile.write(mergedString)
outputFile.close